/*
 * Listener.h
 *
 *  Created on: 2.4.2011
 *      Author: Tomas Srna
 */

#ifndef LISTENER_H_
#define LISTENER_H_

#include "IFile.h"
#include <pthread.h>
#include <iostream>
#include <sys/socket.h>
#include <netinet/in.h>
#include <cstring>
#include <fcntl.h>
#include <arpa/inet.h>
#include "Packet.h"
#include "TransferFactory.h"

class Listener {
private:
	int port;
	IFile& fs;
	std::ostream& logger;
	int sock;
	struct sockaddr_in server;
	std::vector<pthread_t> threads;
public:
	Listener(IFile * f, int p = 69,
			std::ostream& logr = std::cout);
	void run ();
};

#endif /* LISTENER_H_ */
